package com.buddy.design.pattern._05strategy.pay;

import com.buddy.design.pattern._05strategy.pay.payport.Payment;

public class Order {
    private String uid;
    private String orderId;
    private double amount;

    public Order(String uid, String orderId, double amount) {
        this.uid = uid;
        this.orderId = orderId;
        this.amount = amount;
    }

    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public double getAmount() {
        return amount;
    }

    public void setAmount(double amount) {
        this.amount = amount;
    }

    public MsgResult pay(String payType){
        Payment payment = PayStrategy.getPayment(payType);
        System.out.println(">>>欢迎使用"+payment.getName());
        System.out.println(">>>本次交易金额："+amount);
        return payment.pay(uid,amount);
    }
}
